<template>
  <a-card hoverable :title="item.title" class="practice-title"
   :headStyle="{background:'#c5f7ff'}"
   @click="router.push(`/practice/practiceMode/${item.id}`)">
    <div class="item-content">
      <div class="totalClass">
        总题数：<span class="numberClass"> {{ item.num }}</span><span class="subDesc">题</span>
      </div>
      <a-flex class="description">
        <div style="">描&nbsp;&nbsp;&nbsp;述：
        </div>
        <div class="subDesc">
          {{ item.questionRemark }}
        </div>
      </a-flex>
      <div class="time">
        <a-flex>
          更新于：
          <div class="subDesc">{{ item.updateTime ? item.updateTime : item.createTime }}</div>
        </a-flex>
        <a-button type="primary" plain size="small"
                  @click="router.push(`/practice/practiceMode/${item.id}`)">开始练习
        </a-button>
      </div>
    </div>
  </a-card>
</template>
<script lang="ts" setup>
import router from "@/router";

const props = defineProps({
  loading: {
    type: Boolean,
    default: false
  },
  item: {
    type: Object,
    default: {}
  }
});

</script>
<style lang="less" scoped>
.tagClass {
  font-size: 14px;
}

.practice-title{
	.ant-card-head{
		background-color:rgba(0,0,0,.5)
	}
}
.item-content {
  padding: 10px;
  width: 100%;
  text-align: left;

  .title {
    font-size: 16px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  p {
    margin: 8px 0;
    font-size: 14px;
    color: #777;
    letter-spacing: 0;
    line-height: 22px;

    a {
      color: #3370ff;
      display: inline;
    }
  }

  span {
    line-height: 14px;
  }

  a {
    transition: color .3s;
    overflow: hidden;
    display: flex;
    cursor: pointer;
    color: black;
  }

  a:hover {
    color: #3370ff;
  }
}

.numberClass {
  color: #1890FF;
  font-style: italic;
  margin: 0 3px;
}

.totalClass {
  color: black;
  line-height: 24px;
  height: 24px;
  margin-bottom: 5px;
}

.subDesc {
  color: #777
}

.time {
  color: black;
  display: flex;
  justify-content: space-between;
}

.description {
  line-height: 24px;
  height: 48px;
  margin-bottom: 10px;;
}
</style>
